package org.csu.mypetstore.util;

import org.apache.tomcat.util.codec.binary.Base64;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
/**
 * 描述：通过MD5来实现加密效果；
 */
public class MD5Util {
    public static final String SALT="uybY687]TBC9j,[0hkVBHy76";

    public static String getMD5String(String strValue) throws NoSuchAlgorithmException {
        MessageDigest md5 = MessageDigest.getInstance("MD5");
        return Base64.encodeBase64String(md5.digest((strValue + SALT).getBytes()));
    }
}
